import LoginWork from "@/utils/LoginWork"
import service from "@/utils/request"

export interface UpperBodyTableData{
    pageTotal:number,
    stockSum:number,
    dto:dtoTable[]
}

export interface dtoTable{
    factory: null,
    lotNo: number,
    style: string,
    stockQty: null,
    inShort: null,
    outShort: null,
    color: string,
    ordQty: number
}

export interface UpperBodyTableDataParameters{
    color:string,
    factory:string,
    lotNo:string,
    pageNum:number,
    pageSize:number,
    style:string
}

export const VampStockInquiry = (parms:UpperBodyTableDataParameters) => {
    return service.put<any,UpperBodyTableData>('/pcFactorQuery/queryStitchStockHead',parms)
}

export interface VampWarehouseAccounts{
    detailDtos:detailDtos[]
    inDtos:inDtos[]
    ordSum:number
    rpSum: number
    inSum: number
    outDtos:outDtos[],
    outSum: number,
    stockSum: number,
    ordShortSum:number,
    spShortSum:number
}

export interface  detailDtos{
    sizeNo: string,
    ordQty: number,
    inQty: number,
    lsNo: number,
    ordShort: number,
    surplusShort: number,
    outQty: number,
    stockQty: number,
    rePrint: null,
    inFlag: string,
    outFlag: null,
    backgroundColor?:string
    
}

export interface  inDtos{
    deptName: string,
    date: null,
    qty: number,
    sysUser: string,
    slipType: string
}

export interface  outDtos{
    deptName: string,
    date: null,
    qty: number,
    sysUser: string,
    slipType: string
}

export const VampWarehouseAccount = (lotNo:any) => {
    return service.get<any,VampWarehouseAccounts>(`/pcFactorQuery/queryStitchStockDetail`,{
        params:{lotNo}
    })
}

// 更新数据
export const updateData = () => {
    return LoginWork.get<any,any>(`/pcFactorQuery/updateStitchStatus`)
}